<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:jwork="http://irian.at/jsfatwork"
      xmlns:rich="http://richfaces.org/rich">

<ui:composition template="/templates/template.xhtml">
    <ui:define name="heading">
        <h:outputText value="Order - Symbol"/>
    </ui:define>
    <ui:define name="content">
        <h:panelGrid columns="4">
            <h:outputLabel value="Enter Stock Symbol"/>
            <h:panelGroup>
                <h:inputText value="#{orderBean.stockSymbol}" id="symbol"/>
                <rich:suggestionbox for="symbol"
                                    suggestionAction="#{orderBean.autocomplete}" var="stock"
                                    minChars="1"
                                    height="20"
                                    width="100">
                    <h:column>
                        <h:outputText value="#{stock.symbol}"/>
                    </h:column>
                </rich:suggestionbox>
            </h:panelGroup>
            <h:commandButton value="Buy" action="#{orderBean.buy}"/>
            <h:commandButton value="Sell" action="#{orderBean.sell}"/>
        </h:panelGrid>
    </ui:define>
</ui:composition>

</html>